package com.g7.dsp.forprotocol.contexts;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JPanel;

import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;

import com.chinaway.dsp.test.MessageSend;
import com.g7.dsp.forprotocol.beans.SWTBean;
import com.g7.dsp.forprotocol.services.Converter;

public class ProtocolContext {
	// Constants
	public static final String SELECT_LABEL = "选择";
	public static final String CONVERT = "解析";
	//公共常量
	public static final int SMART = 1;
	public static final int CTBOX = 2;
	public static final int BUBIAO = 3;
	//协议选择对象+协议策略容器
	public static final String[] BUBIAO_LABELS={"..........请选择.........."};
	public static final String[] MQTT_LABELS={"..........请选择.........."};
	
	// For Singleton Object
	private static ProtocolContext prt = null;

	// Properties
	private int protocolSelected;
	private List<String> fileList;
	private int errorFileCount = 0;
	private String outputFilePath = null;

	// Constructors
	private ProtocolContext() {
        
	}

	public static ProtocolContext getProtocolContext() {
		if (prt == null) {
			synchronized (ProtocolContext.class) {
				if (prt == null) {
					prt = new ProtocolContext();
					//初始化HashMap
				}
			}
		}
		return prt;
	}

	

	public List<String> getFileList() {
		return fileList;
	}

	public void setFileList(List<String> fileList) {
		this.fileList = fileList;
	}

	public int getErrorFileCount() {
		return errorFileCount;
	}

	public void setErrorFileCount(int errorFileCount) {
		this.errorFileCount = errorFileCount;
	}
	
	public void getAndIncreErrorCount(){
		this.errorFileCount = getErrorFileCount()+1;
	}
	
	public int getProtocolSelected() {
		return protocolSelected;
	}

	public void setProtocolSelected(int protocolSelected) {
		this.protocolSelected = protocolSelected;
	}
	
	
	public String getOutputFilePath() {
		return outputFilePath;
	}

	public void setOutputFilePath(String outputFilePath) {
		this.outputFilePath = outputFilePath;
	}
	
	
}
